package Dao;

import java.util.ArrayList;
import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import Bean.JoinBean;
import Bean.MusicBean;
import Bean.SingerBean;
import Bean.rowBean;

public class MusicDao extends SqlMapClientDaoSupport {

	public List<JoinBean> GetTopTanList() {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"getTopTanList");
	}
	
	//--------가수별 찾기
	public List<JoinBean> searchSingerList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"searchSingerList",row);
	}
	//--------제목별 찾기
	public List<JoinBean> searchMusicList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"searchMusicList",row);
	}
	//--------가수별 데이터수
	public int searchSingerTotal(String search) {
		return (int) getSqlMapClientTemplate().queryForObject("searchSingerTotal",search);
	}
	//--------제목별 데이터수
	public int searchMusicTotal(String search) {
		return (int) getSqlMapClientTemplate().queryForObject("searchMusicTotal",search);
	}
	
	
	
	public MusicBean getMusic(int ms_no) {
		return (MusicBean) getSqlMapClientTemplate().queryForObject("getMusic",ms_no);
	}

	
	public int getNewTotal(rowBean row) {
		return (int) getSqlMapClientTemplate().queryForObject("getNewTotal",row);
	}
	public int getBalladeTotal(rowBean row) {
		return (int) getSqlMapClientTemplate().queryForObject("getBalladeTotal",row);
	}
	public int getDanceTotal(rowBean row) {
		return (int) getSqlMapClientTemplate().queryForObject("getDanceTotal",row);
	}
	public int getHiphopTotal(rowBean row) {
		return (int) getSqlMapClientTemplate().queryForObject("getHiphopTotal",row);
	}
	public int getRockTotal(rowBean row) {
		return (int) getSqlMapClientTemplate().queryForObject("getRockTotal",row);
	}
	public int getOSTTotal(rowBean row) {
		return (int) getSqlMapClientTemplate().queryForObject("getOSTTotal",row);
	}

	// ------최신음악 리스트 getNewMusicList / 최근 6개 앨범명
	public List<JoinBean> GetNewMusicList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"getNewMusicList", row);
	}
	public List<MusicBean> GetNewAlbum(rowBean row) {
		return (List<MusicBean>) getSqlMapClientTemplate().queryForList(
				"getNewAlbum", row);
	}

	// ------발라드음악 리스트 getNewMusicList / 최근 6개 앨범명
	public List<JoinBean> GetBalladeMusicList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"getBalladeMusicList", row);
	}
	public List<MusicBean> GetBalladeAlbum() {
		return (List<MusicBean>) getSqlMapClientTemplate().queryForList(
				"getBalladeAlbum");
	}

	// ------댄스음악 리스트 getNewMusicList / 최근 6개 앨범명
	public List<JoinBean> GetDanceMusicList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"getDanceMusicList", row);
	}
	public List<MusicBean> GetDanceAlbum() {
		return (List<MusicBean>) getSqlMapClientTemplate().queryForList(
				"getDanceAlbum");
	}

	// ------힙합음악 리스트 getNewMusicList / 최근 6개 앨범명
	public List<JoinBean> GetHiphopMusicList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"getHiphopMusicList", row);
	}
	public List<MusicBean> GetHiphopAlbum() {
		return (List<MusicBean>) getSqlMapClientTemplate().queryForList(
				"getHiphopAlbum");
	}

	// ------락 음악 리스트 getNewMusicList / 최근 6개 앨범명
	public List<JoinBean> GetRockMusicList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"getRockMusicList", row);
	}
	public List<MusicBean> GetRockAlbum() {
		return (List<MusicBean>) getSqlMapClientTemplate().queryForList(
				"getRockAlbum");
	}
	// ------OST음악 리스트 getNewMusicList / 최근 6개 앨범명
	public List<JoinBean> GetOSTMusicList(rowBean row) {
		return (List<JoinBean>) getSqlMapClientTemplate().queryForList(
				"getOSTMusicList", row);
	}
	public List<MusicBean> GetOSTAlbum() {
		return (List<MusicBean>) getSqlMapClientTemplate().queryForList(
				"getOSTAlbum");
	}
	
}
